<template>
  <div>
    <el-dialog
      title="告警用户"
      :visible.sync="dialogVisible"
      width="75%">
      <div>
        <div class="bodybox">
          <div class="table">
            <TableColumn
            ref="tabledata"
            :tableData="tableData" 
            :tableConfig="tableConfig" 
            ></TableColumn>
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button size="small" @click="dialogVisible = false">取 消</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {getabnormalUserList} from '@/api/prwpaid/summarize/overview'
import TopTile from '@/components/TopTitle/index.vue'
import TableColumn from '@/components/Table/index.vue'
import {exportexcel} from '@/utils/excel'
export default {
  name: 'CallPolicedialoglist',
  components: {
    TopTile,
    TableColumn
  },
  props: {
    buildingId: {
      type: String,
      default:''
    }
  },
  data() {
    return {
      issize: 'medium',
      dialogVisible: false,
      tableData: [],
      tableConfig: [
      { label: '序号', type:'index' ,center:'center',width:'100'},
        { label: '建筑群名称', prop: 'buildingName',width:'200' },
        { label: '用户名称', prop: 'customerName' ,width:'250'},
        { label: '用户编号', prop: 'customerCode' },
        { label: '异常记录', prop: 'alarmRecord' ,width:'450'},
        { label: '记录时间', prop: 'recordTime' ,center:'center'},
      ],
      pageobj: {
        pageNo: 1,
        pageSize:20
      },
      totalCount:''
    };
  },

  mounted() {
    // this.gettablelist()
    console.log('异常用户弹窗');
    
  },

  methods: {
    // 获取表格数据
    async gettablelist() {
      // this.$refs.tabledata.loading=true
      const { data: { list,totalCount } } = await getabnormalUserList({
        buildingId: this.buildingId, 
      })
      this.tableData = list
      this.totalCount = totalCount
      // this.$refs.tabledata.loading=false
    },
  },
};
</script>
<style lang="scss" scoped>
  .bodybox{
    // height: 500px;
    padding: 20px;
    background-color: #fff;
    .table{
      height: 500px;
      margin: 10px 0;
    }
  }
  ::v-deep .el-dialog__footer{
  text-align: center;
}
</style>